// 配置编译环境和线上环境之间的切换
import axios from "axios";

let baseUrl = "";
let publish = "";
let iconfontVersion = ["567566_pwc3oottzol", "1066523_6bvkeuqao36"];
let iconfontUrl = `//at.alicdn.com/t/font_$key.css`;
let codeUrl = `${baseUrl}/code`;
const env = process.env;
if (env.NODE_ENV == "development") {
  // baseUrl = `http://106.13.231.246`; // 开发环境地址
  baseUrl = "/";
} else if (env.NODE_ENV == "production") {
  // baseUrl = `http://106.13.231.246`; //生产环境地址
  baseUrl = `/`; //生产环境地址
  publish = "/xl";
} else if (env.NODE_ENV == "test") {
  // baseUrl = `http://106.13.231.246`; //测试环境地址
  baseUrl = `/`;
  publish = "/xl";
}
axios.defaults.baseURL = baseUrl;
export { baseUrl, iconfontUrl, iconfontVersion, codeUrl, env, publish };
